jQuery Mobile กับการสร้าง Header, Body และ Footer
บทความวันที่ 12 ตุลาคม 2555
บทความนี้จะกล่าวถึงเรื่องการสร้างส่วนการแสดงผลของ Header, Body และ Footer ด้วย JQuery Mobile Framework ครับ ซึ่งไม่ว่าการพัฒนาโปรแกรมบนอะไรก็แล้วแต่เช่น Software Application, Web Application หรือ Mobile Application ต่างก็ต้องมี 3 ส่วนที่เป็นส่วนแบ่งที่สำคัญของโปรแกรมนั้นก็คือ ส่วน Header, Body และ Footer ครับ
ตัวอย่างโปรแกรม
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/default/jquery.mobile.css" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.mobile.js"></script>
</head>
<body>
<div data-role="page">
<div data-role="header"><h1>Header</h1></div>
<div data-role="content"><center>Body</center></div>
<div data-role="footer"><h1>Footer</h1></div>
</div>
</body>
</html>
อธิบายโปรแกรม
1. การสร้างส่วน Header สามารถสร้างได้จากคำสั่ง data-role="header"
2. การสร้างส่วน Body หรือใน JQuery Mobile เรียกว่าส่วน Content สามารถสร้างได้จากคำสั่ง data-role="content"
3. การสร้างส่วน Footer สามารถสร้างได้จากคำสั่ง data-role="footer"
ผลลัพธ์

คำค้นหา jQuery Mobile Header, Body, Footer, รับสอนเขียนโปรแกรม, รับเขียนเว็บไซต์